<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name="viewport" content="width=device-width">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>519消防网</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="/plugins/layui/css/layui.css?v=<?php echo time()?>" rel="stylesheet">
    <link href="/css/home/base.css?v=<?php echo time()?>" rel="stylesheet">
</head>
<body>
@include('home.common.header')
<style>
    .active {
        color: #DD4517;
    }

    .layui-form-item {
        min-width: 1140px;
    }

    .label {
        padding-left: 0px;
        padding-right: 15px;
        text-align: left;
        cursor: pointer;
        width: auto;
    }

    .layui-input-small {
        height: 28px;
        margin-top: 5px;
    }
</style>
<div style="width: 1140px;margin: 15px auto 15px auto;  ">
    首页 > 职位
</div>


<div style="max-width: 1140px;margin: 0px auto;padding-bottom:20px;border-radius: 6px">
    <div style="background: #fff;">
        <form class="layui-form" id="search_form" action="" style="padding-top: 30px;padding-bottom: 30px">
            <input type="hidden" name="a" value="{{Input::get('a')}}">
            <input type="hidden" name="p" value="{{Input::get('p')}}">

            <div class="layui-form-item area">

                <label class="layui-form-label">区域：</label>

                <div class="layui-input-block">
                    <label class="layui-form-label label @if(!Input::get('a') || Input::get('a') == 0) active @endif"
                           data-area="0">不限</label>
                    <label class="layui-form-label label @if(Input::get('a')==1) active @endif"
                           data-area="1">萧山区</label>
                    <label class="layui-form-label label @if(Input::get('a')==2) active @endif"
                           data-area="2">富阳区</label>
                    <label class="layui-form-label label @if(Input::get('a')==3) active @endif"
                           data-area="3">淳安县</label>
                    <label class="layui-form-label label @if(Input::get('a')==4) active @endif"
                           data-area="4">余杭区</label>
                    <label class="layui-form-label label @if(Input::get('a')==5) active @endif"
                           data-area="5">临安区</label>
                    <label class="layui-form-label label @if(Input::get('a')==6) active @endif"
                           data-area="6">桐庐县</label>
                    <label class="layui-form-label label @if(Input::get('a')==7) active @endif"
                           data-area="7">西湖区</label>
                    <label class="layui-form-label label @if(Input::get('a')==8) active @endif"
                           data-area="8">江干区</label>
                    <label class="layui-form-label label @if(Input::get('a')==9) active @endif" data-area="9">
                        拱墅区</label>
                    <label class="layui-form-label label @if(Input::get('a')==10) active @endif" data-area="10">
                        下城区</label>
                    <label class="layui-form-label label @if(Input::get('a')==11) active @endif" data-area="11">
                        上城区</label>
                    <label class="layui-form-label label @if(Input::get('a')==12) active @endif"
                           data-area="12">滨江区</label>

                </div>
            </div>
            <div class="layui-form-item price">

                <label class="layui-form-label">薪资：</label>

                <div class="layui-input-block">
                    <label class="layui-form-label label @if(!Input::get('p') || Input::get('p') == 0) active @endif>"
                           data-p="0">不限</label>
                    <label class="layui-form-label label @if(Input::get('p')==1) active @endif" data-p="1">
                        3000以下</label>
                    <label class="layui-form-label label @if(Input::get('p')==2) active @endif"
                           data-p="2">3000-5000</label>
                    <label class="layui-form-label label @if(Input::get('p')==3) active @endif"
                           data-p="3">5000-8000</label>
                    <label class="layui-form-label label @if(Input::get('p')==4) active @endif"
                           data-p="4">8000-12000</label>
                    <label class="layui-form-label label @if(Input::get('p')==5) active @endif"
                           data-p="5">12000以上</label>

                    {{--<div class="layui-inline" style="float: left">--}}
                    {{--<div class="layui-input-inline" style="width: 100px;">--}}
                    {{--<input type="text" name="pn" placeholder="￥" autocomplete="off"--}}
                    {{--class="layui-input layui-input-small" value="{{Input::get('pn')}}">--}}
                    {{--</div>--}}
                    {{--<div class="layui-form-mid">-</div>--}}
                    {{--<div class="layui-input-inline" style="width: 100px;">--}}
                    {{--<input type="text" name="pm" placeholder="￥" autocomplete="off"--}}
                    {{--class="layui-input layui-input-small" value="{{Input::get('pm')}}">--}}
                    {{--</div>--}}
                    {{--</div>--}}
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">其他：</label>

                <div class="layui-input-inline ">
                    <select name="s1" lay-filter="s1">
                        <option value="">学历水平</option>
                        <option value="1" @if(Input::get('s1') == 1) selected @endif >本科</option>
                        <option value="2" @if(Input::get('s1') == 2) selected @endif >大专</option>
                        <option value="3" @if(Input::get('s1') == 3) selected @endif >中学</option>
                        <option value="4" @if(Input::get('s1') == 4) selected @endif >其他</option>
                    </select>
                </div>
                <div class="layui-input-inline">
                    <select name="s2" lay-filter="s2">
                        <option value="">工作经验</option>
                        <option value="1" @if(Input::get('s2') == 1) selected @endif>无限制</option>
                        <option value="2" @if(Input::get('s2') == 2) selected @endif>1-3年</option>
                        <option value="3" @if(Input::get('s2') == 3) selected @endif>3-5年</option>
                        <option value="4" @if(Input::get('s2') == 4) selected @endif>5年以上</option>
                    </select>
                </div>
                <div class="layui-input-inline">
                    <select name="s3" lay-filter="s3">
                        <option value="">发布时间</option>
                        <option value="1" @if(Input::get('s3') == 1) selected @endif >今天</option>
                        <option value="2" @if(Input::get('s3') == 2) selected @endif >昨天</option>
                        <option value="3" @if(Input::get('s3') == 3) selected @endif >最近3天</option>
                        <option value="4" @if(Input::get('s3') == 4) selected @endif >最近一周</option>
                        <option value="5" @if(Input::get('s3') == 5) selected @endif >最近30天</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-md7">
                    <label class="layui-form-label">搜索：</label>

                    <div class="layui-input-block">
                        <input type="text" name="s" class="layui-input" value="{{Input::get('s')}}">
                    </div>
                </div>
                <div class="layui-col-md1" style="color: #fff">
                    11
                </div>
                <div class="layui-col-md3">
                    <button class="layui-btn submit " style="background: #DD4517">提交</button>
                    <button class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
    <div style="margin: 10px auto;padding-bottom:20px;border-radius: 6px">
        <div style="background:#fff;">
            @foreach($job as $item)
                <div style="overflow: hidden;border-bottom: 1px solid #f5f5f5;padding: 15px 50px;">
                    <div style="float: left;margin-right:15px;width: 400px">
                        <div style="height: 25px;line-height: 25px;font-size: 16px;"><span
                                    style="font-size: 18px">{{$item['title']}}</span> <span style="margin-left: 15px;color: #f6ab00;">{{$item['salary_name']}}元/月</span>
                        </div>

                        <div style="height: 45px;line-height: 45px;color: #666"><span>工作经验：不限</span><span> 学历：不限</span>
                        </div>
                        <?php $tab = explode('|', $item['tab']) ?>
                        <div style="line-height: 25px;">
                            @foreach($tab as $tab_item)
                                <label class="tab">{{$tab_item}}</label>
                            @endforeach
                        </div>
                    </div>
                    <a href="{{url('/info/'.$item['id'])}}" class="layui-btn layui-btn-sm"
                       style="float: right;margin-top: 36px;background: #DD4517">申请职位</a>

                    <div style="float: right;margin-right: 20px;width: 300px">
                        <div class="company">{{$item['company_name']}}</div>
                        <div style="height: 45px;line-height: 35px;font-size: 14px; color:#666">发布时间：昨天
                        </div>

                    </div>
                </div>
            @endforeach
        </div>

    </div>


</div>
@include('home.common.footer')
<script src="/js/jquery-3.2.1.min.js"></script>
<script src="/plugins/layui/layui.js" charset="utf-8"></script>

<script>
    $('.submit').click(function () {
        var url = window.location.href;
        $('.search_form').attr('action', url);
        $('.search_form').submit();
    });
    layui.use(['form', 'layer'], function () {
        var form = layui.form();//重点处
        form.on('select(s1)', function (data) {

        });
        form.on('select(s2)', function (data) {

        });
        form.on('select(s3)', function (data) {

        });
    });
    $('.area label').click(function () {
        $(this).siblings().removeClass('active');
        $(this).addClass('active');
        var area = $(this).data('area');
        var url = window.location.href;
        var newUrl = changeURLArg(url, "a", area);
        window.location.href = newUrl;
        //window.history.pushState({}, "", newUrl);

    });
    $('.price label').click(function () {
        var url = window.location.href;
        var p = $(this).data('p');
        var newUrl = changeURLArg(url, "p", p);
        $(this).siblings().removeClass('active');
        $(this).addClass('active');
        window.location.href = newUrl;
        //window.history.pushState({}, "", newUrl);

    });
    $('.layui-unselect').change(function () {
        alert(1);
    });
    function changeURLArg(url, arg, arg_val) {
        var pattern = arg + '=([^&]*)';
        var replaceText = arg + '=' + arg_val;
        if (url.match(pattern)) {
            var tmp = '/(' + arg + '=)([^&]*)/gi';
            tmp = url.replace(eval(tmp), replaceText);
            return tmp;
        } else {
            if (url.match('[\?]')) {
                return url + '&' + replaceText;
            } else {
                return url + '?' + replaceText;
            }
        }
        return url + '\n' + arg + '\n' + arg_val;
    }
    function deleteUrlParam(url, name) {
        var pattern = name + '=([^&]*)';
        var replaceText = '';
        if (url.match(pattern)) {
            var tmp = '/(' + name + '=)([^&]*)/gi';
            tmp = url.replace(eval(tmp), replaceText);
            return tmp;
        } else {
            if (url.match('[\?]')) {
                return url + '&' + replaceText;
            } else {
                return url + '?' + replaceText;
            }
        }
        return url;

    }
    function getUrlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
        var r = window.location.search.substr(1).match(reg); //匹配目标参数
        if (r != null) return unescape(r[2]);
        return null; //返回参数值
    }
</script>
</body>
</html>
